package rensoft.portfolio.client.view.pages;

import static com.google.gwt.query.client.GQuery.$;

import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptException;
import com.google.gwt.dom.client.Document;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiFactory;

import static cs.java.lang.Lang.doLater;

import cs.java.lang.Run;




import rensoft.gwt.client.view.View;
import rensoft.portfolio.client.model.titles.Page;

public class ContactView extends View<PageView> {

  static Binder uiBinder = GWT.create(Binder.class);

  private static native Document parseFacebook() /*-{
		$wnd.FB.XFBML.parse();
  }-*/;

  private final Page page;

  public ContactView(Page page) {
    super.initialize(this.page = page);
    initWidget(uiBinder.createAndBindUi(this));
    doLater(new Run() {
      public void run() {
        try {
          parseFacebook();
        } catch (JavaScriptException e) {}
        $(asWidget()).fadeIn(3000);
      }
    });
  }

  @UiFactory
  PageView createPageView() {
    return new PageView(page);
  }

  interface Binder extends UiBinder<PageView, ContactView> {}
}
